#!/bin/bash

menu(){
	echo -e "\t\e[31m====================================================\e[0m"
	echo -e "\t\t\e[1;35m 1.select all singer information\e[0m"
	echo -e "\t\t\e[1;35m 2.insert a  singer information\e[0m"
	echo -e "\t\t\e[1;35m 3.exit\e[0m"
	echo -e "\t\e[31m====================================================\e[0m"
	echo -n -e "\e[34m please input you option\e[0m";read u_option
}
#1.
select_info(){
	cat -n singer.txt
}
#2.
insert(){
	echo -e "\t\e[1;34m please input singer information\e[0m:\e[31m(name sex address type age production)\e[0m";read u_name u_sex u_addr u_type u_age u_pro
	declare -A u_singer
	u_singer=([name]=${u_name} [sex]=${u_sex} [addre]=${u_addr} [singer_type]=${u_type} [age]=${u_age} [production]=${u_pro})

	echo ${u_singer[@]} >>singer.txt 
	cat -n singer.txt
}
main(){
while :
do 
menu
case $u_option in
1)
select_info
;;
2)
insert
;;
3)
exit
;;
*)
exit
;;
esac
done
}
main;
